+1999-10-29 Michael Fulbright <drmike@redhat.com>
+
+ * src/gdk-pixbuf-loader.c (gdk_pixbuf_loader_write): Actually
+ load the image handler when we determine the image type.
+
+ * src/gdk-pixbuf-io.[ch] (gdk_pixbuf_load_module): Changed the
+ previously static function load_image_handler () to
+ a public function gdk_pixbuf_load_module (). It is needed in
+ gdk-pixbuf-loader.c to load image handler modules. This function
+ is different from gdk_pixbuf_get_module (), which only returns
+ a reference to the required handler, because it actually loads
+ the handler into memory. Both actions should possibly be combined
+ in a convenience function since one w/o the other doesn't seem to
+ make much sense.
+
1999-10-28 Federico Mena Quintero <federico@redhat.com>
* src/gdk-pixbuf-render.c (gdk_pixbuf_render_to_drawable): New
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL }
};
-static void
-image_handler_load (GdkPixbufModule *image_module)
+
+/* actually load the image handler - gdk_pixbuf_get_module only get a */
+/* reference to the module to load, it doesn't actually load it */
+/* perhaps these actions should be combined in one function */
+void
+gdk_pixbuf_load_module (GdkPixbufModule *image_module)
{
char *module_name;
char *path;
image_module = gdk_pixbuf_get_module (buffer, size);
if (image_module){
if (image_module->module == NULL)
- image_handler_load (image_module);
+ gdk_pixbuf_load_module (image_module);
if (image_module->load == NULL) {
fclose (f);
GdkPixbuf *pixbuf;
if (file_formats[XPM_FILE_FORMAT_INDEX].module == NULL) {
- image_handler_load(&file_formats[XPM_FILE_FORMAT_INDEX]);
+ gdk_pixbuf_load_module(&file_formats[XPM_FILE_FORMAT_INDEX]);
}
if (file_formats[XPM_FILE_FORMAT_INDEX].module == NULL) {
* Miguel de Icaza <miguel@gnu.org>
* Federico Mena-Quintero <federico@gimp.org>
* Jonathan Blandford <jrb@redhat.com>
+ * Michael Fulbright <drmike@redhat.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
GdkPixbufModule *gdk_pixbuf_get_module (gchar *buffer, gint size);
+void gdk_pixbuf_load_module (GdkPixbufModule *image_module);
priv->image_module = gdk_pixbuf_get_module (priv->buf, 128);
if (priv->image_module == NULL)
return FALSE;
- else if ((priv->image_module->begin_load == NULL) ||
- (priv->image_module->stop_load == NULL) ||
- (priv->image_module->load_increment == NULL)) {
+ else if (priv->image_module->module == NULL)
+ gdk_pixbuf_load_module (priv->image_module);
+
+ if ((priv->image_module->begin_load == NULL) ||
+ (priv->image_module->stop_load == NULL) ||
+ (priv->image_module->load_increment == NULL)) {
g_warning ("module %s does not support incremental loading.\n",
priv->image_module->module_name);
return FALSE;
} else {
priv->context = (*priv->image_module->begin_load) (
gdk_pixbuf_loader_prepare, loader);
-
+
if (priv->context == NULL) {
g_warning("Failed to begin progressive load");
return FALSE;
priv->image_module = gdk_pixbuf_get_module (priv->buf, 128);
if (priv->image_module == NULL)
return FALSE;
- else if ((priv->image_module->begin_load == NULL) ||
- (priv->image_module->stop_load == NULL) ||
- (priv->image_module->load_increment == NULL)) {
+ else if (priv->image_module->module == NULL)
+ gdk_pixbuf_load_module (priv->image_module);
+
+ if ((priv->image_module->begin_load == NULL) ||
+ (priv->image_module->stop_load == NULL) ||
+ (priv->image_module->load_increment == NULL)) {
g_warning ("module %s does not support incremental loading.\n",
priv->image_module->module_name);
return FALSE;
} else {
priv->context = (*priv->image_module->begin_load) (
gdk_pixbuf_loader_prepare, loader);
-
+
if (priv->context == NULL) {
g_warning("Failed to begin progressive load");
return FALSE;